<?php echo $this->render('layouts/__header.phtml'); ?>
<?php echo $this->render('layouts/__nav.phtml'); ?>
<h1>User Maintain Wizard</h1><br>   
<form action="<?php echo $this->baseUrl() ?>/wizard/user" method="POST" id="wuser" name="wuser">
<input type="hidden" id="act" name="act" value="search"/>
<input type="hidden" id="userid" name="userid" value=""/>
    <h3>User List:</h3>
     <table class="normaltable">
			<tr>
			  <td></td>			  
			  <td><input name="qName" id="qName" type="text" size="15" value="<?php echo $this->pagingParams['name'];?>" /></td>					
              <td></td>
			  <td></td>
			  <td><select name="qTeam" id="qTeam">
                      <option value="">- Team -</option>
                      <?php foreach($this->userTeamList as $k=>$team):?>                      
                      <option value="<?php echo $team['teamId'];?>" <?php if($this->pagingParams['tt_team_id'] == $team['teamId']):?>selected<?php endif;?>><?php echo $team['teamName'];?></option>                      
                      <?php endforeach;?>
                    </select></td>										
			  <td><select name="qRole" id="qRole">
                      <option value="">- Role -</option>
                      <?php foreach($this->userRoleList as $k=>$role):?>
                      <option value="<?php echo $role['roleId'];?>" <?php if($this->pagingParams['tt_role_id'] == $role['roleId']):?>selected<?php endif;?>><?php echo $role['roleName'];?></option>                     
                      <?php endforeach;?>
                    </select></td>	
              <td></td>				
			</tr>		
			<tr class="tit">			 
					<td>ID</td>
					<td>Name</td>
					<td>Phone</td>
					<td>Email</td>					
					<td>Team</td>
					<td>Role</td>
                    <td>Actions</td>					
			</tr>
			<?php foreach($this->userList as $k=>$user):?>
			<tr onMouseOver="this.style.backgroundColor='#F7F9F9';" onMouseOut="this.style.backgroundColor='#FFFFFF'">				
				<td><?php echo $user['userId'];?></td>
				<td><?php echo $user['userName'];?></td>
				<td><?php echo $user['phone'];?></td>
				<td><?php echo $user['email'];?></td>
				<td><?php echo $user['teamName'];?></td>
				<td><?php echo $user['roleName'];?></td>
                <td><a href="#" onclick="editUser(<?php echo $user['userId'];?>)"><img src="/images/b_edit.png" border="0"></a> 
                &nbsp; <a href="#" onclick="delUser(<?php echo $user['userId'];?>,'<?php echo $user['userName'];?>')"><img src="/images/b_empty.png" border="0"></a></td>
			</tr>
			<?php endforeach;?>
		</table>
		<div class="pagelist" <?php if (!$this->pager) {echo 'style="display:none"';} ?> ><?php echo $this->pager['prevStr'];?>&nbsp;<?php echo $this->pager['pageStr'];?>&nbsp;<?php echo $this->pager['nextStr'];?>&nbsp;<input id="pageto" type="text" /><a id="gopagebtn" href="javascript:;">Go</a></div>
	<br>    
    <h3>Add new user:</h3>
    <?php echo $this->render('layouts/__info.phtml'); ?>
    <table class="normaltable lefttable">
    <tr><td>Name</td><td><input type="text" id="name" name="name" value="<?php echo $this->name; ?>"></td></tr>
     <tr><td>Password</td><td><input type="password" id="passwd" name="passwd" ></td></tr>
    <tr><td>Phone</td><td><input type="text" id="phone" name="phone" value="<?php echo $this->phone; ?>"></td></tr>
    <tr><td>Mail</td><td><input type="text" id="email" name="email" value="<?php echo $this->email; ?>"></td></tr>
    <tr><td>Team</td><td>
    <select id="team" name="team">
	<?php foreach($this->teamList as $team):?>	
    <option value="<?php echo $team->id;?>"><?php echo $team->name;?></option>                     
	<?php endforeach;?>    
	</select></td></tr>
	<tr><td>Role</td><td>
    <select id="role" name="role">
	<?php foreach($this->roleList as $role):?>
    <option value="<?php echo $role->id;?>"><?php echo $role->name;?></option>                     
	<?php endforeach;?>    
	</select>
	</td></tr>    
    <tr><td colspan="2" style="text-align:right"><input type="button" value="Create" id="adduser" name="adduser" /></td></tr>
    </table>
</form>

<?php echo $this->render('layouts/__footer.phtml'); ?>